home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / misc / pdflib / p_port.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  2KB  |  82 lines

  1. /* p_port.h
  2.  * Copyright (C) 1997-98 Thomas Merz. All rights reserved.
  3.  *
  4.  * PDFlib portability stuff
  5.  */
  6.  
  7. #ifndef P_PORT_H
  8. #define P_PORT_H
  9.  
  10. /* ---------------------- Windows -------------------*/
  11. #ifdef _WIN32
  12. #define WIN32
  13. #define PDF_HAS_BOOL
  14. #endif
  15.  
  16. #ifdef WIN32
  17. #define NEED_GETOPT
  18. #define READMODE    "rb"
  19. #define WRITEMODE    "wb"
  20. #endif
  21.  
  22. /* ---------------------- MS-DOS -------------------*/
  23. #ifdef DOS
  24. #define NEED_GETOPT
  25. #define READMODE    "rb"
  26. #define WRITEMODE    "wb"
  27. #endif
  28.  
  29. /* ---------------------- Macintosh -------------------*/
  30. #ifdef MAC
  31. #define NEED_GETOPT
  32. #define READMODE    "rb"
  33. #define WRITEMODE    "wb"
  34. #define PATHSEP        ":"
  35. #endif
  36.  
  37. /* ---------------------- NeXT -------------------*/
  38.  
  39. #ifdef NeXT
  40. #endif
  41.  
  42. /* ---------------------- Defaults -------------------*/
  43. /* Note: the defaults section is essentially the POSIX section
  44.  * since this is my main development platform
  45.  */
  46.  
  47. #ifndef WRITEMODE
  48. #define WRITEMODE    "w"
  49. #endif
  50.  
  51. #ifndef READMODE
  52. #define READMODE    "r"
  53. #endif
  54.  
  55. #ifndef PATHSEP
  56. #define PATHSEP        "/"
  57. #endif
  58.  
  59. /*
  60.  * Define PI if we don't have it already
  61.  * This is the case for Watcom 10.6, for example.
  62.  */
  63. #ifndef M_PI
  64. #define M_PI        3.14159265358979323846      /* pi */
  65. #endif
  66.  
  67. #ifdef NEED_GETOPT
  68. extern int getopt(int nargc, char **nargv, char * ostr);
  69. extern char *optarg;
  70. extern int optind;
  71. #endif
  72.  
  73. /* The dreaded boolean type is introduced in so many places.
  74.  * The PDF_HAS_BOOL define is a humble attempt to handle this situation.
  75.  */
  76.  
  77. #ifndef PDF_HAS_BOOL
  78. typedef int bool;
  79. #endif
  80.  
  81. #endif            /* P_PORT_H */
  82.